<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page import="java.util.Calendar" %>
<% String title = "信息综合系统"; %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>
<title><%=title %>-协议日志管理</title>
<head>
<script type="text/javascript">
//获取浏览器页面可见高度和宽度
var _PageHeight = document.documentElement.clientHeight,
  _PageWidth = document.documentElement.clientWidth;
//计算loading框距离顶部和左部的距离（loading框的宽度为215px，高度为61px）
var _LoadingTop = _PageHeight > 61 ? (_PageHeight - 61) / 2 : 0,
  _LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2 : 0;
//在页面未加载完毕之前显示的loading Html自定义内容
var _LoadingHtml = '<div id="loadingDiv" style="position:absolute;left:0;width:100%;height:' + _PageHeight + 'px;top:0;background:white;opacity:1;filter:alpha(opacity=80);z-index:10000;"><div style="position: absolute; cursor1: wait; left: ' + _LoadingLeft + 'px; top:' + _LoadingTop + 'px; width: auto; height: 57px; line-height: 57px; padding-left: 50px; padding-right: 5px; background: #fff url(${pageContext.request.contextPath}/img/loading.gif) no-repeat scroll 5px 10px; border: 2px solid #95B8E7; color: #696969; font-family:\'Microsoft YaHei\';">页面加载中，请等待......</div></div>';
//呈现loading效果
document.write(_LoadingHtml);

//监听加载状态改变
document.onreadystatechange = completeLoading;
//加载状态为complete时移除loading效果
function completeLoading() {
  if (document.readyState == "complete") {
	 var loadingMask = document.getElementById('loadingDiv');
	 loadingMask.parentNode.removeChild(loadingMask);
  } 
}
</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="apple-itunes-app" content="app-id=429849944"/>
<meta name="apple-touch-fullscreen" content="no"/>
<meta content="telephone=no" name="format-detection"/>
<meta name="apple-mobile-web-app-capable" content="no"/>
</head>

<!-- BEGIN BODY -->
<body class="fixed-top">

<jsp:include page="/common/headerPage.jsp"></jsp:include>
<!-- BEGIN CONTAINER 容器 -->
<div id="container" class="row-fluid">
    <!-- BEGIN SIDEBAR 侧边栏-->
    <jsp:include page="/common/left.jsp"></jsp:include>
    <!-- END SIDEBAR -->

    <!-- BEGIN PAGE -->
    <div id="main-content">
        <!-- BEGIN PAGE CONTAINER-->
        <div class="container-fluid">
            <!-- BEGIN PAGE HEADER-->
            <div class="row-fluid">
                <div class="span12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title">协议日志管理</h3>
                    <ul class="breadcrumb" style="padding-bottom : 12px;">
                        <li><a href="${pageContext.request.contextPath}/user/index.do">首页</a>
                            <span class="divider">/</span></li>
                        <li class="active">协议日志管理</li>
                        <li class="pull-right search-wrap">
                            <input type="button" class="btn  btn-info" onclick="toggleCondi();" id="show"
                                   value="隐藏筛选区域"/>
                             &nbsp;&nbsp;
                             <div class="btn-group pull-right">
			                    <button class="btn dropdown-toggle" data-toggle="dropdown">更多 <i class="icon-angle-down"></i>
			                    </button>
			                    <ul class="dropdown-menu pull-right">
			                        <li><a href="${pageContext.request.contextPath}/policyLog/download.do">下载已筛选协议日志</a></li>
			                    </ul>
			                </div>     
                        </li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <!-- END PAGE HEADER-->
            <!-- BEGIN BASIC PORTLET-->
            <div class="widget">
                <div class="row-fluid">
                    <div class="clearfix" >
                    <form id="filterForm">
                    <input type="text" class="span2" id="policyid" name="id" placeholder="请填写协议ID" 
                           onblur="if(!/^[0-9]+$/.test(this.value)){layer.msg('ID只能输入【数字】');this.value='';}"   />
                    <%-- <input type="text" class="span2" id="client" name="client" placeholder="请填写客户" data-provide="typeahead"
                               data-items="4"/>
                    <select id="product" name="product" multiple="multiple"
                        onMouseOver="this.title='选择品种'" size="1"
                        class="input-medium m-wrap">
                        <c:forEach items="${products}" var="product" >
                           <option value="${product}">${product}</option>
                       </c:forEach>
                    </select> 
                    <select id="page" size="1" name="page" multiple="multiple"
                         class="input-medium m-wrap">
                        <c:forEach items="${packs}" var="page">
                            <option value="${page}">${page}</option>
                        </c:forEach>
                    </select>
                    <input type="text" class="span2" id="qsterminal" name="qsterminal" placeholder="请填写入货乙方" data-provide="typeahead"
                               data-items="4"/> --%>
                    <input type="button" id="seach" name="seach" value="查询" class="btn  btn-primary"
                               style="margin-bottom: 10px;"
                               onclick="query(pNumber,pSize);">
                    </form>
                    </div>
                </div>
               
				<div class="row-fluid">
                	<div class="span12">
                    <!-- BEGIN ALERTS PORTLET-->
                    <div class="widget blue">
                        <div class="widget-title">
                            <h4><i class="icon-reorder"></i>协议日志查询列表</h4>
                            <span class="tools">
								<a href="javascript:;" class="icon-chevron-down"></a>
							</span>
                        </div>
				    
                        <div class="widget-body" style="overflow:auto">
	                        <div class="pageBottom" style="text-align:center;">
	                            <input type="hidden" id="page-size" value="0"/>
	                            <div id="callBackPager" class="paging_bootstrap pagination"></div> 
	                        </div>
                        	<table class="table table-striped table-hover table-bordered" width="2640px;"
                                style="table-layout:fixed">
                                <thead>
                                <tr>
                                    <!-- <th style="width:15px;"><input type="checkbox" name="choiceAll" value="all" id ="allAndNotAll"/></th>
                                     --><th style="width:25px;">logid</th>
                                    <th style="width:40px;">修改者</th>
                                    <th style="width:150px;">修改时间</th>
                                    <th style="width:50px;">修改类型</th>
                                    <th width="40px">省份</th>
                                    <th width="60px">经理/条线 </th>
                                    <th width="60px">客户/代表</th>
                                    <th width="60px">入货乙方</th>
                                    <th width="70px">开始时间</th>
                                    <th width="70px">结束时间</th>
                                    <th width="60px">票据方案</th>
                                    <th width="40px">协议ID</th>
                                    <th width="40px">状态</th>
                                    <th width="60px">模式/品规</th>
                                    <th width="60px">结算方式</th>
                                    <th width="45px">中标价</th>
                                    <th width="45px">开票价</th>
                                    <th width="70px">标准测算价</th>
                                    <th width="70px">协议测算价 </th>
                                    <th width="88px">1服务费(基础)</th>
                                    <th width="88px">3服务费(财务)</th>
                                    <th width="88px">4服务费(达标)</th>
                                    <th width="88px">5开发奖励</th>
                                    <th width="88px">业务员开发奖励</th>
                                    <th width="60px">资金成本</th>
                                    <th width="60px">基础政策 </th>
                                    <th width="30px">渠道 </th>
                                    <th width="50px">地市 </th>
                                    <th width="270px">协议备注</th>
                                    <th width="60px">协议标杆</th>
                                    <th width="150px">收款人 </th>
                                    <th width="230px">开户行 </th>
                                    <th width="200px">账号 </th>
                                </tr>
                                </thead>
                                <tbody id="distribute-body">
                                <input type="hidden" id="selectIds" value="${ids }"/>
                                </tbody>

                                <tbody id="distribute-body">
                        		</tbody>
                            </table>
                        </div>

                    </div>
                    <!-- END ALERTS PORTLET-->
                	</div>
            	</div>
               
            </div>
            <!-- END BASIC PORTLET-->
        </div>
    </div>
</div>

<!-- BEGIN FOOTER -->
<jsp:include page="/common/footer.jsp"></jsp:include>
<!-- END FOOTER -->

<!-- BEGIN JAVASCRIPTS -->
<!-- Load javascripts at bottom, this will reduce page load time -->
<%--<script src="js/jquery-1.8.3.min.js"></script>--%>
<script src="${pageContext.request.contextPath}/js/jquery-1.7.1.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.nicescroll.js" type="text/javascript"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.slimscroll.min.js"></script>
<script src="${pageContext.request.contextPath}/js/fullcalendar.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.easy-pie-chart.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.sparkline.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/Chart.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.scrollTo.min.js"></script>
<!--common script for all pages-->
<script src="${pageContext.request.contextPath}/js/common-scripts.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath}/js/layer/layer.js"></script>
<%--<script src = "${pageContext.request.contextPath}/js/jquery.min.js" > </script>--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap-multiselect.css" type="text/css"/>

<script src="${pageContext.request.contextPath}/js/bootstrap-typeahead.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/extendPagination.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="http://img3.job1001.com/js/ZeroClipboard/jquery.zclip.min.js"></script>

<!-- END JAVASCRIPTS -->
<!-- 自定义的script方法 -->
<script type="text/javascript">
    $(document).ready(function () {
   	    selectMoreItem('product','品种','80px');
   	    selectMoreItem('page','包装','80px');
   	    
        $("#show").click(function () {
            $(".clearfix").slideToggle();
        });
    });
   /* var terminal = ${condiMap.terminal};
    $('#terminal').typeahead({source: terminal})*/
    if ( window.clipboardData ) {
        $('#getProp').click(function() {
            var ids = getProp();  
            if(selectedIds.trim().length>0){
       		   ids = selectedIds;
       	    }
            if(ids.trim().length>0){
                window.clipboardData.setData("Text", ids);
                layer.msg("复制成功！"); 
                $("#allAndNotAll").attr("checked", false);  
                $("input[name='choice']:checkbox").each(function(){ 
                    $(this).attr("checked", false);  
              	});
                layer.msg("复制成功！");
            }else{
                layer.alert("您没有选中行！");
            }
        });
    } else {
        $("#getProp").zclip({
            path:'http://img3.job1001.com/js/ZeroClipboard/ZeroClipboard.swf',
            copy:function(){
                   var ids = getProp();  
                   if(selectedIds.trim().length>0){
              		   ids = selectedIds;
              	    }
                   if(ids.trim().length>0){
                       return ids;
                   }else{
                       layer.msg("您没有选中行！");
                   }
                },
            afterCopy:function(){
            	layer.msg("复制成功！"); 
                $("#allAndNotAll").attr("checked", false);  
                $("input[name='choice']:checkbox").each(function(){ 
                    $(this).attr("checked", false);  
              	});
            	layer.msg("复制成功！");
            }
        });
    }
</script>

<script type="text/javascript">
    function query(pageNumber, pageSize) {
    	var policyId = $("#policyid").val();
    	if(policyId.trim()==''){
    		layer.msg("请填写协议ID!");
    	}else{
	        var url = "${pageContext.request.contextPath }/policyLog/selectForList.do?pageNumber="
	                + pageNumber + "&pageSize=" + pageSize;
	        var params = $("#filterForm").serialize();
	        queryList(url,params);
    	}
    }

    //动态创建table
    function createTable(currPage, limit, total, items) {
    	 var html = [], showNum = limit;
         if (total - (currPage * limit) < 0) showNum = total - ((currPage - 1) * limit);
         for (var i = 0; i < showNum; i++) {
        	html.push("<tr>");
            html.push('<td>' + formatData(items[i].logId) + '</td>');
            html.push('<td>' + formatData(items[i].logDataer) + '</td>');
            html.push('<td>' + formatData(items[i].logTime) + '</td>');
            html.push('<td>' + formatData(items[i].logType) + '</td>');
            html.push('<td>' + formatData(items[i].province) + '</td>');
            html.push('<td>' + formatData(items[i].mgr)+ '/'+formatData(items[i].qudaolie) + '</td>');
            html.push('<td>' + formatData(items[i].client)+ '/'+formatData(items[i].daibiao)  + '</td>');
            html.push('<td>' + formatData(items[i].qsterminal) + '</td>');
            html.push('<td>' + formatData(items[i].xieyistarttime) + '</td>');
            html.push('<td>' + formatData(items[i].xieyiendtime) + '</td>');
            html.push('<td>' + formatData(items[i].kaipiaofangshi) + '</td>');
            html.push('<td>' + formatData(items[i].id) + '</td>');
            html.push('<td>' + formatData(items[i].guihuanriqi) + '</td>');
            html.push('<td>' + formatData(items[i].mode) + '/' +formatData(items[i].product)+''+formatData(items[i].page)+ '</td>');
            html.push('<td>' + formatData(items[i].jsmode) + '</td>');
            html.push('<td>' + formatData(items[i].zhongbiaojia) + '</td>');
            html.push('<td>' + formatData(items[i].kaipiaojia) + '</td>');
            html.push('<td>' + formatData(items[i].biaozhuncsdj) + '</td>');
            html.push('<td>' + formatData(items[i].dijia) + '</td>');
            html.push('<td>' + formatData(items[i].tuiguangmoney) + '</td>');
            html.push('<td>' + formatData(items[i].fapiaomoney) + '</td>');
            html.push('<td>' + formatData(items[i].daibiaomoney) + '</td>');
            html.push('<td>' + formatData(items[i].kaifajianlishixiang) + '</td>');
            html.push('<td>' + formatData(items[i].kaifaMgr) + '</td>');
            html.push('<td>' + formatData(items[i].zijingchengben) + '</td>');
            html.push('<td>' + formatData(items[i].basicpolicy) + '</td>');
            html.push('<td>' + formatData(items[i].terminaltype) + '</td>');
            html.push('<td>' + formatData(items[i].city) + '</td>');
            html.push('<td>' + formatData(items[i].terminal) + '</td>');
            html.push('<td>' + formatData(items[i].xieyibiaogang) + '</td>');
            html.push('<td>' + formatData(items[i].shoukuangren) + '</td>');
            html.push('<td>' + formatData(items[i].kaihuhang) + '</td>');
            html.push('<td>' + formatData(items[i].zhanghao) + '</td>');
            html.push('</tr>');
        }
        var mainObj = $('#distribute-body');
        mainObj.empty();
        mainObj.html(html.join(''));
    };


</script>
<!-- END BODY -->
<script>
    var htmls = $("#updatePlanLogForm").html();
    var uploadFileHtml = $("#uploadFileForm").html();
    var ret = null;
    //所有选中的id
    var selectedIds = "";
    /* //全选或全不选
    $("#allAndNotAll").click(function() { 
        if (this.checked){  
            $("input[name='choice']:checkbox").each(function(){ 
                  $(this).attr("checked", true);  
            });
            layer.msg('拼命执行中，请稍等……', {icon: 16}, function(){
            	layer.closeAll();
            	layer.load(2);
            	//发送异步请求，获取数据
                sendRequest(pageContextPath + "/planLog/selectIds.do", null, function (jsonData) {
                    selectedIds = jsonData.ids;
                    layer.closeAll();
                });
            });
        } else {   
            $("input[name='choice']:checkbox").each(function() {   
                  $(this).attr("checked", false);  
            });
            selectedIds="";
        }  
    }); */
</script>
<script src="${pageContext.request.contextPath}/javascript/httpService.js"></script>
<style type="text/css">
	.Textwrap {  
		width: 150px; 
		white-space: nowrap; 
		text-overflow: ellipsis; 
		overflow: hidden; 
	} 
</style>
</body>
</html>